{extend name="top/index" /}
{block name="main"}
	<div class="page-content-wrapper">
		<div class="page-content" >
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
							<h4 class="modal-title">Modal title</h4>
						</div>
						<div class="modal-body">
							 Widget settings form goes here
						</div>
						<div class="modal-footer">
							<button type="button" class="btn blue">Save changes</button>
							<button type="button" class="btn default" data-dismiss="modal">Close</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
			</div>
			<!-- /.modal -->
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN STYLE CUSTOMIZER -->
			<div class="theme-panel hidden-xs hidden-sm">
				
				<div class="toggler-close">
				</div>
				<div class="theme-options">
					<div class="theme-option theme-colors clearfix">
						<span>
							 THEME COLOR
						</span>
						<ul>
							<li class="color-black current color-default" data-style="default">
							</li>
							<li class="color-blue" data-style="blue">
							</li>
							<li class="color-brown" data-style="brown">
							</li>
							<li class="color-purple" data-style="purple">
							</li>
							<li class="color-grey" data-style="grey">
							</li>
							<li class="color-white color-light" data-style="light">
							</li>
						</ul>
					</div>
					<div class="theme-option">
						<span>
							 Layout
						</span>
						<select class="layout-option form-control input-small">
							<option value="fluid" selected="selected">Fluid</option>
							<option value="boxed">Boxed</option>
						</select>
					</div>
					<div class="theme-option">
						<span>
							 Header
						</span>
						<select class="header-option form-control input-small">
							<option value="fixed" selected="selected">Fixed</option>
							<option value="default">Default</option>
						</select>
					</div>
					<div class="theme-option">
						<span>
							 Sidebar
						</span>
						<select class="sidebar-option form-control input-small">
							<option value="fixed">Fixed</option>
							<option value="default" selected="selected">Default</option>
						</select>
					</div>
					<div class="theme-option">
						<span>
							 Sidebar Position
						</span>
						<select class="sidebar-pos-option form-control input-small">
							<option value="left" selected="selected">Left</option>
							<option value="right">Right</option>
						</select>
					</div>
					<div class="theme-option">
						<span>
							 Footer
						</span>
						<select class="footer-option form-control input-small">
							<option value="fixed">Fixed</option>
							<option value="default" selected="selected">Default</option>
						</select>
					</div>
				</div>
			</div>
			<!-- END STYLE CUSTOMIZER -->
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
					个人中心
					</h3>
					<ul class="page-breadcrumb breadcrumb">
						<!-- <li class="btn-group">
							<button type="button" class="btn blue dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
							<span>
								Actions
							</span>
							<i class="fa fa-angle-down"></i>
							</button>
							<ul class="dropdown-menu pull-right" role="menu">
								<li>
									<a href="#">
										Action
									</a>
								</li>
								<li>
									<a href="#">
										Another action
									</a>
								</li>
								<li>
									<a href="#">
										Something else here
									</a>
								</li>
								<li class="divider">
								</li>
								<li>
									<a href="#">
										Separated link
									</a>
								</li>
							</ul>
						</li> -->
						<li>
							<i class="fa fa-home"></i>
							<a href="{:url('index/index/index')}">
								Home
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
							<a href="{:url('index/user/index')}">
								个人中心
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row profile">
				<div class="col-md-12">
					<!--BEGIN TABS-->
					<div class="tabbable tabbable-custom tabbable-full-width">
						<ul class="nav nav-tabs">
							<li class="active">
								<a href="#tab_1_1" data-toggle="tab">
									 个人信息
								</a>
							</li>
							<li>
								<a href="#tab_1_3" data-toggle="tab">
									 修改登录密码
								</a>
							</li>
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="tab_1_1" >
								<div class="row profile-account">
									<div class="col-md-3">
										<ul class="ver-inline-menu tabbable margin-bottom-10">
											<li class="active">
												<a data-toggle="tab" href="#tab_1-1">
													<i class="fa fa-cog"></i> 个人信息
												</a>
												<span class="after">
												</span>
											</li>
											<!-- <li>
												<a data-toggle="tab" href="#tab_2-2">
													<i class="fa fa-picture-o"></i> 头像
												</a>
											</li> -->
											
										</ul>
									</div>
									<div class="col-md-9">
										<div class="tab-content">
											<div id="tab_1-1" class="tab-pane active">
												<!-- <form role="form" action="{:url('index/User/edit')}" method="post"> -->
													<div class="form-group">
														<label class="control-label">姓名</label>
														<input type="text" value="{$user.user_name}" class="form-control" disabled="" id="name" />
													</div>
													<div class="form-group">
														<label class="control-label">邮箱</label>
														<input type="text" value="{$user.user_email}" class="form-control" id="email" />
													</div>
													<div class="form-group">
														<label class="control-label">手机号</label>
														<input type="text" value="{$user.user_mobile}" class="form-control" id="mobile" />
													</div>
													<div class="form-group">
														<label class="control-label">办公电话</label>
														<input type="text" value="{$user.user_office_phone}" class="form-control" id="office_phone" />
													</div>
													<div class="form-group">
														<label class="control-label">工作地点</label>
														<input type="text" value="{$user.user_working_place}" class="form-control" id="working_place" />
													</div>
													<div class="form-group">
														<label class="control-label">备注</label>
														<textarea class="form-control" rows="3" value="{$user.user_remarks}" id="remarks"></textarea>
													</div>
													
													<div class="margiv-top-10">
														<button class="sub-btn btn-success btn">
															 保存修改
														</button>
														<a href="{:url('index/User/index')}" class="btn default">
															 取消
														</a>
													</div>


												<!-- </form> -->
											</div>
											<!-- <div id="tab_2-2" class="tab-pane">
												<p>
													 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod.
												</p>
												<form action="#" role="form">
													<div class="form-group">
														<div class="fileinput fileinput-new" data-provides="fileinput">
															<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
																<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
															</div>
															<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">
															</div>
															<div>
																<span class="btn default btn-file">
																	<span class="fileinput-new">
																		 Select image
																	</span>
																	<span class="fileinput-exists">
																		 Change
																	</span>
																	<input type="file" name="...">
																</span>
																<a href="#" class="btn default fileinput-exists" data-dismiss="fileinput">
																	 Remove
																</a>
															</div>
														</div>
														<div class="clearfix margin-top-10">
															<span class="label label-danger">
																 NOTE!
															</span>
															<span>
																 Attached image thumbnail is supported in Latest Firefox, Chrome, Opera, Safari and Internet Explorer 10 only
															</span>
														</div>
													</div>
													<div class="margin-top-10">
														<a href="#" class="btn green">
															 Submit
														</a>
														<a href="#" class="btn default">
															 Cancel
														</a>
													</div>
												</form>
											</div> -->
											
										</div>
									</div>
									<!--end col-md-9-->
								</div>
							</div>
							<!--tab_1_2-->
							<div class="tab-pane" id="tab_1_3">
								<div class="row profile-account">
									
									
										<div class="tab-content" style="min-height: 500px;">
											<div class="col-md-3">
												<ul class="ver-inline-menu tabbable margin-bottom-10">
													<li class="active">
														<a data-toggle="tab" href="#tab_1-1">
															<i class="fa fa-cog"></i> 修改密码
														</a>
														<span class="after">
														</span>
													</li>
											<!-- <li>
												<a data-toggle="tab" href="#tab_2-2">
													<i class="fa fa-picture-o"></i> 头像
												</a>
											</li> -->
											
										</ul>
											</div>
											<div class="col-md-9">
												<div id="tab_1-1" class="tab-pane active">
													<!-- <form role="form" action="#"> -->
														<div class="form-group">
															<label class="control-label " >登录用户名</label>&nbsp; &nbsp; {$user.user_name}
															<button class="btn btn-default sub-name" style="float: right;" type="button" data-toggle="modal" data-target=".bs-example-modal-lg">修改用户名</button>
														</div>
														
														<div class="form-group">
															<label class="control-label" >当前密码</label>&nbsp; &nbsp; &nbsp; ******
															<button class="btn btn-default sub-password" style="float: right;"  type="button" data-toggle="modal" data-target=".bs-example-modal-lgx">修改密码</button>
														</div>
														<!-- 模态框 -->
															<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
															  <div class="modal-dialog modal-lg" role="document">
															    <div class="modal-content">
																<div class="modal-header">
																	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																		&times;
																	</button>
																	<h4 class="modal-title" id="myModalLabel">
																		修改用户名
																	</h4>
																</div>
																<div class="modal-body">
																	<table class="table table-striped table-bordered table-hover" id="datatable_shipment">
																		<tbody>
																			<tr>
																				<th>新的用户名</th>
																					<td   colspan="4">
																						<input type="text" name="login_name" value=""style="" id="newname" class="form-control">
																					</td>
																			</tr>
																			<tr>
																				<th>
																					登录密码
																				</th>
																				<td colspan="4">
																					<input type="password" name="password" value="" style="" id="mima" class="form-control">
																				</td>
																			</tr>
																		</tbody>
																		</table>

																</div>
																<div class="modal-footer">
																	<button type="button" class="btn btn-default" data-dismiss="modal">关闭
																	</button>
																	<button type="button" class="btn btn-primary run-btn">
																		提交更改
																	</button>
																</div>
															</div><!-- /.modal-content -->
															  </div>
															</div>
														<!--  -->

														<!-- 模态框 -->
															<div class="modal fade bs-example-modal-lgx" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
															  <div class="modal-dialog modal-lg" role="document">
															    <div class="modal-content">
																<div class="modal-header">
																	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																		&times;
																	</button>
																	<h4 class="modal-title" id="myModalLabel">
																		修改密码
																	</h4>
																</div>
																<div class="modal-body">
																	<table  class="table table-striped table-bordered table-hover" id="datatable_shipment">
																		<tbody>
																			<tr>
																				<th>当前密码
																					<td colspan="4">
																						<input type="text" name="login_name" value=""style="" id="nowmima" class="form-control">
																					</td>
																				</th>
																			</tr>
																			<tr>
																				<th>
																					新密码
																				</th>
																				<td colspan="4">
																					<input type="password" name="password" value="" style="" id="newmima" class="form-control">
																				</td>
																			</tr>
																			<tr>
																				<th>
																					确认新密码
																				</th>
																				<td>
																					<input type="password" name="password" value="" style="" id="confirmmima" class="form-control">
																				</td>
																			</tr>
																		</tbody>
																		</table>

																</div>
																<div class="modal-footer">
																	<button type="button" class="btn btn-default" data-dismiss="modal">关闭
																	</button>
																	<button type="button" class="btn btn-primary go-btn">
																		提交更改
																	</button>
																</div>
															</div><!-- /.modal-content -->
															  </div>
															</div>
														<!--  -->
												</div>
											</div>
										</div>
									<!--end col-md-9-->
								</div>
							</div>
							
							
								<!--end row-->
								
								<!--end row-->
							</div>
							<!--end tab-pane-->
							
							<!--end tab-pane-->
						</div>
					</div>
					<!--END TABS-->
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="footer">
	<div class="footer-inner">
		 2018 &copy; 仁聚科技
	</div>
	<div class="footer-tools">
		<span class="go-top">
			<i class="fa fa-angle-up"></i>
		</span>
	</div>
</div>

<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="assets/plugins/respond.min.js"></script>
<script src="assets/plugins/excanvas.min.js"></script> 
<![endif]-->

<!-- END PAGE LEVEL SCRIPTS -->
<!-- <script>
jQuery(document).ready(function() {       
   // initiate layout and plugins
   App.init();
});
</script> -->
<link href="/static/assets/css/toastr.min.css" rel="stylesheet"/>
<script src="/static/assets/js/toastr.min.js" rel="stylesheet"/></script>

<script>
	$(function(){
    $('.sub-btn').click(function () {
      postdata();
    });

     function postdata(){     
         //提交数据函数   
        toastr.options = {  
            closeButton: true,  
            debug: false,  
            progressBar: true,  
            positionClass: "toast-top-right",  
            onclick: null,  
            showDuration: "1000",  
            hideDuration: "1000",  
            timeOut: "1000",  
            extendedTimeOut: "1000",  
            showEasing: "swing",  
            hideEasing: "linear",  
            showMethod: "fadeIn",  
            hideMethod: "fadeOut"  
        };
        $.ajax({                                                  //调用jquery的ajax方法   
          type: "POST",                                      //设置ajax方法提交数据的形式   
          url: '/index/User/edit',                                        
          data: {
                  // name : $("name").val(),
                  email : $("#email").val(),
                  mobile : $("#mobile").val(),
                  office_phone : $("#office_phone").val(),
                  working_place : $("#working_place").val(),
                  remarks : $("#remarks").val(),
              }, 
          success: function(data){  
          console.log(data);     
          if (data) {
            toastr.success('修改成功');
            setInterval(function(){
              window.location.reload();
            }, 1000);
            // location.href='http://47.96.69.12/index/index/show/id/'+$("#id").val()+'.html';
          }else{
            toastr.error('评论失败，请重试');
          }
        },
        error: function () {
                alert('AJAX操作失败');
            }
        });   
     }   
    })
</script>
<script>
	$('.run-btn').click(function () {
      run();
      console.log(8888);
    });

    function run(){     
         //提交数据函数   
        toastr.options = {  
            closeButton: true,  
            debug: false,  
            progressBar: true,  
            positionClass: "toast-top-right",  
            onclick: null,  
            showDuration: "1000",  
            hideDuration: "1000",  
            timeOut: "1000",  
            extendedTimeOut: "1000",  
            showEasing: "swing",  
            hideEasing: "linear",  
            showMethod: "fadeIn",  
            hideMethod: "fadeOut"  
        };
        $.ajax({                                                  //调用jquery的ajax方法   
          type: "POST",                                      //设置ajax方法提交数据的形式   
          url: '/index/User/nameEdit',                                        
          data: {
                  // name : $("name").val(),
                  name : $("#newname").val(),
                  pwd : $("#mima").val()
              }, 
          success: function(data){  
          console.log(data);     
          if (data) {
            toastr.success('修改成功');
            setInterval(function(){
              window.location.reload();
            }, 1000);
            // location.href='http://47.96.69.12/index/index/show/id/'+$("#id").val()+'.html';
          }else{
            toastr.error('修改失败，请重试');
          }
        },
        error: function () {
                alert('AJAX操作失败');
            }
        });   
     }   
</script>
<script>
	$('.go-btn').click(function () {
      go();
      // console.log(8888);
    });

    function go(){     
         //提交数据函数   
        toastr.options = {  
            closeButton: true,  
            debug: false,  
            progressBar: true,  
            positionClass: "toast-top-right",  
            onclick: null,  
            showDuration: "1000",  
            hideDuration: "1000",  
            timeOut: "1000",  
            extendedTimeOut: "1000",  
            showEasing: "swing",  
            hideEasing: "linear",  
            showMethod: "fadeIn",  
            hideMethod: "fadeOut"  
        };
        $.ajax({                                                  //调用jquery的ajax方法   
          type: "POST",                                      //设置ajax方法提交数据的形式   
          url: '/index/User/pwdEdit',                                        
          data: {
                  // name : $("name").val(),
                  nowmima : $("#nowmima").val(),
                  newmima : $("#newmima").val(),
                  confirmmima : $("#confirmmima").val()
              }, 
          success: function(res){  
          console.log(res);     
          if (res) {
            toastr.success('修改成功');
            setInterval(function(){
              window.location.reload();
            }, 1000);
            // location.href='http://47.96.69.12/index/index/show/id/'+$("#id").val()+'.html';
          }else{
            toastr.error('修改失败，请重试');
          }
        },
        error: function () {
                alert('AJAX操作失败');
            }
        });   
     }   
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>
{/block}